#autoBuild.sh

 


set timeout 30

printf "开始执行脚本\n"

pm2 stop 0
if [ $? -eq 0 ]; then
    echo "停止服务 成功 \n"
    printf "拉取代码\n"
else
    echo "停止服务 失败结束自动部署\n"
    exit 1   
fi

git reset HEAD
git clean -f
git pull
expect "Username" 
send "1373513133@qq.com"
expect "Password"
send "d1373513133"
interact
if [ $? -eq 0 ]; then
    echo "拉取代码 成功 \n" 
else
    echo "拉取代码 失败 结束自动部署\n"
    exit 1  
fi 
ls
 
